import { postAxios, getAxios } from '@/utils/http'

export const strategyApi = {
    getAccessStaff:(data)=>{
      return postAxios('/access/staff',data); 
    },
    getAccessDevice:(data)=>{
      return postAxios('/access/device',data); 
    },
    getAccessStaffByStrategyId:(data)=>{
      return getAxios('/access/allow/staff/'+data); 
    },
    getAllStrategy:()=>{
      return getAxios('/access/strategy/all'); 
    },
    getAccessDeviceByStrategyId:(data)=>{
      return getAxios('access/allow/device/'+data); 
    },
    changeOn:(data)=>{
      return getAxios('/access/strategy/change/on?isOn='+data.isOn+"&strategyId="+data.strategyId); 
    },
    deleteStrategyById: (data)=>{
      return getAxios('/access/strategy/delete?id='+data.id+"&strategyId="+data.strategyId);
    },
    // 查询通行策略
    getStrategyList: (data) => {
      return postAxios('/access/strategy/list', data);
    },
    // 新增通行策略
    addStrategy: (data) => {
      return postAxios('/access/strategy/add', data);
    },
    // 修改通行策略
    updateStrategy: (data) => {
      return postAxios('/access/strategy/update', data);
    },
    // 删除通行策略
    deleteStrategy: (data) => {
      return getAxios('/access/strategy/delete' + data);
    },
    getStrategyDevices: (data) => {
      return getAxios('/access/strategy/devices?strategyId=' + data.strategyId);
    },
    
    deleteBatchStrategy: (data) => {
      return postAxios('/access/batch/delete' ,data);
    },
    getTagAndDevice:(strategyId) => {
      return getAxios('/access/strategy/tag/decice/?strategyId=' + strategyId);
    }
  
  }
  
  